﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDbBlockTableRecord : OdDbSymbolTableRecord
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbBlockTableRecord(IntPtr cPtr, bool cMemoryOwn) : base(TD_DbPINVOKE.OdDbBlockTableRecord_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbBlockTableRecord obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbBlockTableRecord()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDbBlockTableRecord(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdDbBlockTableRecord cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbBlockTableRecord_cast(OdRxObject.getCPtr(pObj));
			OdDbBlockTableRecord result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbBlockTableRecord)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbBlockTableRecord)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbBlockTableRecord)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbBlockTableRecord_desc(), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbBlockTableRecord_isA(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbBlockTableRecord_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdDbBlockTableRecord createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbBlockTableRecord_createObject();
			OdDbBlockTableRecord result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbBlockTableRecord)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbBlockTableRecord)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbBlockTableRecord)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbObjectId appendOdDbEntity(OdDbEntity pEntity)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr cPtr = TD_DbPINVOKE.OdDbBlockTableRecord_appendOdDbEntity(this.swigCPtr, OdDbEntity.getCPtr(pEntity));
			OdDbObjectId result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject(new OdDbObjectId(cPtr, true));
				result = new OdDbObjectId(cPtr, false);
			}
			else
			{
				result = new OdDbObjectId(cPtr, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbObjectIterator newIterator(bool atBeginning, bool skipDeleted, bool sorted)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbBlockTableRecord_newIterator__SWIG_0(this.swigCPtr, atBeginning, skipDeleted, sorted);
			OdDbObjectIterator result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbObjectIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbObjectIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbObjectIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbObjectIterator newIterator(bool atBeginning, bool skipDeleted)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbBlockTableRecord_newIterator__SWIG_1(this.swigCPtr, atBeginning, skipDeleted);
			OdDbObjectIterator result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbObjectIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbObjectIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbObjectIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbObjectIterator newIterator(bool atBeginning)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbBlockTableRecord_newIterator__SWIG_2(this.swigCPtr, atBeginning);
			OdDbObjectIterator result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbObjectIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbObjectIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbObjectIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbObjectIterator newIterator()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbBlockTableRecord_newIterator__SWIG_3(this.swigCPtr);
			OdDbObjectIterator result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbObjectIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbObjectIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbObjectIterator)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public string comments()
		{
			string result = TD_DbPINVOKE.OdDbBlockTableRecord_comments(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setComments(string comments)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_setComments(this.swigCPtr, comments);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public string pathName()
		{
			string result = TD_DbPINVOKE.OdDbBlockTableRecord_pathName(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setPathName(string pathName)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_setPathName(this.swigCPtr, pathName);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGePoint3d origin()
		{
			OdGePoint3d result = new OdGePoint3d(TD_DbPINVOKE.OdDbBlockTableRecord_origin(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setOrigin(OdGePoint3d origin)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_setOrigin(this.swigCPtr, OdGePoint3d.getCPtr(origin));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbBlockBegin openBlockBegin(OpenMode openMode)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbBlockTableRecord_openBlockBegin__SWIG_0(this.swigCPtr, (int)openMode);
			OdDbBlockBegin result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbBlockBegin)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbBlockBegin)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbBlockBegin)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbBlockBegin openBlockBegin()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbBlockTableRecord_openBlockBegin__SWIG_1(this.swigCPtr);
			OdDbBlockBegin result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbBlockBegin)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbBlockBegin)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbBlockBegin)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbBlockEnd openBlockEnd(OpenMode openMode)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbBlockTableRecord_openBlockEnd__SWIG_0(this.swigCPtr, (int)openMode);
			OdDbBlockEnd result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbBlockEnd)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbBlockEnd)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbBlockEnd)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbBlockEnd openBlockEnd()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbBlockTableRecord_openBlockEnd__SWIG_1(this.swigCPtr);
			OdDbBlockEnd result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbBlockEnd)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbBlockEnd)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbBlockEnd)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool hasAttributeDefinitions()
		{
			bool result = TD_DbPINVOKE.OdDbBlockTableRecord_hasAttributeDefinitions(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isAnonymous()
		{
			bool result = TD_DbPINVOKE.OdDbBlockTableRecord_isAnonymous(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isFromExternalReference()
		{
			bool result = TD_DbPINVOKE.OdDbBlockTableRecord_isFromExternalReference(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isFromOverlayReference()
		{
			bool result = TD_DbPINVOKE.OdDbBlockTableRecord_isFromOverlayReference(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isLayout()
		{
			bool result = TD_DbPINVOKE.OdDbBlockTableRecord_isLayout(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbObjectId getLayoutId()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr cPtr = TD_DbPINVOKE.OdDbBlockTableRecord_getLayoutId(this.swigCPtr);
			OdDbObjectId result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject(new OdDbObjectId(cPtr, true));
				result = new OdDbObjectId(cPtr, false);
			}
			else
			{
				result = new OdDbObjectId(cPtr, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setLayoutId(OdDbObjectId layoutId)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_setLayoutId(this.swigCPtr, OdDbObjectId.getCPtr(layoutId));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getBlockReferenceIds(OdDbObjectIdArray referenceIds, bool directOnly, bool forceValidity)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_getBlockReferenceIds__SWIG_0(this.swigCPtr, OdDbObjectIdArray.getCPtr(referenceIds), directOnly, forceValidity);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getBlockReferenceIds(OdDbObjectIdArray referenceIds, bool directOnly)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_getBlockReferenceIds__SWIG_1(this.swigCPtr, OdDbObjectIdArray.getCPtr(referenceIds), directOnly);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getBlockReferenceIds(OdDbObjectIdArray referenceIds)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_getBlockReferenceIds__SWIG_2(this.swigCPtr, OdDbObjectIdArray.getCPtr(referenceIds));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getErasedBlockReferenceIds(OdDbObjectIdArray referenceIds)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_getErasedBlockReferenceIds(this.swigCPtr, OdDbObjectIdArray.getCPtr(referenceIds));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool isUnloaded()
		{
			bool result = TD_DbPINVOKE.OdDbBlockTableRecord_isUnloaded(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setIsUnloaded(bool isUnloaded)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_setIsUnloaded(this.swigCPtr, isUnloaded);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual bool subWorldDraw(OdGiWorldDraw pWd)
		{
			bool result = TD_DbPINVOKE.OdDbBlockTableRecord_subWorldDraw(this.swigCPtr, OdGiWorldDraw.getCPtr(pWd));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual uint subSetAttributes(OdGiDrawableTraits pTraits)
		{
			uint result = TD_DbPINVOKE.OdDbBlockTableRecord_subSetAttributes(this.swigCPtr, OdGiDrawableTraits.getCPtr(pTraits));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult dwgInFields(OdDbDwgFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbBlockTableRecord_dwgInFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dwgOutFields(OdDbDwgFiler pFiler)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_dwgOutFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult dxfInFields(OdDbDxfFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbBlockTableRecord_dxfInFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dxfOutFields(OdDbDxfFiler pFiler)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_dxfOutFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual void subClose()
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_subClose(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdResult subGetClassID(IntPtr pClsid)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbBlockTableRecord_subGetClassID(this.swigCPtr, pClsid);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult subErase(bool erasing)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbBlockTableRecord_subErase(this.swigCPtr, erasing);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void subHandOverTo(OdDbObject pNewObject)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_subHandOverTo(this.swigCPtr, OdDbObject.getCPtr(pNewObject));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual void copyFrom(OdRxObject p)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_copyFrom(this.swigCPtr, OdRxObject.getCPtr(p));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdDbDatabase xrefDatabase(bool includeUnresolved)
		{
			OdDbDatabase result = (OdDbDatabase)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbBlockTableRecord_xrefDatabase__SWIG_0(this.swigCPtr, includeUnresolved), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbDatabase xrefDatabase()
		{
			OdDbDatabase result = (OdDbDatabase)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbBlockTableRecord_xrefDatabase__SWIG_1(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public XrefStatus xrefStatus()
		{
			XrefStatus result = (XrefStatus)TD_DbPINVOKE.OdDbBlockTableRecord_xrefStatus(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool hasPreviewIcon()
		{
			bool result = TD_DbPINVOKE.OdDbBlockTableRecord_hasPreviewIcon(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getPreviewIcon(OdBinaryData previewIcon)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_getPreviewIcon(this.swigCPtr, OdBinaryData.getCPtr(previewIcon));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setPreviewIcon(OdBinaryData previewIcon)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_setPreviewIcon(this.swigCPtr, OdBinaryData.getCPtr(previewIcon));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public virtual OdDbObject subWblockClone(OdDbIdMapping ownerIdMap, OdDbObject arg1)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbBlockTableRecord_subWblockClone(this.swigCPtr, OdDbIdMapping.getCPtr(ownerIdMap), OdDbObject.getCPtr(arg1));
			OdDbObject result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbObject)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbObject)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbObject)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbSortentsTable getSortentsTable(bool createIfNotFound)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbBlockTableRecord_getSortentsTable__SWIG_0(this.swigCPtr, createIfNotFound);
			OdDbSortentsTable result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbSortentsTable)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbSortentsTable)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbSortentsTable)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbSortentsTable getSortentsTable()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbBlockTableRecord_getSortentsTable__SWIG_1(this.swigCPtr);
			OdDbSortentsTable result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbSortentsTable)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbSortentsTable)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbSortentsTable)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdGiDrawable drawable()
		{
			OdGiDrawable result = (OdGiDrawable)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbBlockTableRecord_drawable(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdResult getGeomExtents(OdGeExtents3d extents)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbBlockTableRecord_getGeomExtents(this.swigCPtr, OdGeExtents3d.getCPtr(extents));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult geomExtentsBestFit(OdGeExtents3d extents, OdGeMatrix3d parentXform)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbBlockTableRecord_geomExtentsBestFit__SWIG_0(this.swigCPtr, OdGeExtents3d.getCPtr(extents), OdGeMatrix3d.getCPtr(parentXform));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdResult geomExtentsBestFit(OdGeExtents3d extents)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbBlockTableRecord_geomExtentsBestFit__SWIG_1(this.swigCPtr, OdGeExtents3d.getCPtr(extents));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdResult assumeOwnershipOf(OdDbObjectIdArray entitiesToMove)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbBlockTableRecord_assumeOwnershipOf(this.swigCPtr, OdDbObjectIdArray.getCPtr(entitiesToMove));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdDbBlockTableRecord.BlockScaling blockScaling()
		{
			OdDbBlockTableRecord.BlockScaling result = (OdDbBlockTableRecord.BlockScaling)TD_DbPINVOKE.OdDbBlockTableRecord_blockScaling(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setBlockScaling(OdDbBlockTableRecord.BlockScaling blockScaling)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_setBlockScaling(this.swigCPtr, (int)blockScaling);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setExplodable(bool explodable)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_setExplodable(this.swigCPtr, explodable);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool explodable()
		{
			bool result = TD_DbPINVOKE.OdDbBlockTableRecord_explodable(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setBlockInsertUnits(UnitsValue blockInsertUnits)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_setBlockInsertUnits(this.swigCPtr, (int)blockInsertUnits);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public UnitsValue blockInsertUnits()
		{
			UnitsValue result = (UnitsValue)TD_DbPINVOKE.OdDbBlockTableRecord_blockInsertUnits(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void applyPartialUndo(OdDbDwgFiler pFiler, OdRxClass pClass)
		{
			TD_DbPINVOKE.OdDbBlockTableRecord_applyPartialUndo(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler), OdRxClass.getCPtr(pClass));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		public enum BlockScaling
		{
			kAny,
			kUniform
		}
	}
}
